package cn.ymatrix.httpTOYMatrix.energyCar;

import org.apache.commons.lang3.time.StopWatch;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

public class EnergyCarDataTOYMatrix {
  private static final Logger LOGGER = LoggerFactory.getLogger(EnergyCarDataTOYMatrix.class);

  public static void main(String[] args) {
    DataHandler dataHandler = new DataHandler();
    StopWatch started = StopWatch.createStarted();
    CountDownLatch latch = new CountDownLatch(1);
    DataHandler.initDeviceAndMeasurement();
    dataHandler.insertDataByBatch(latch);
    LOGGER.info("历史数据写入完成，耗时：{}", started.getTime(TimeUnit.MILLISECONDS));
    System.exit(1);
  }
}
